﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Atacadao.Comum.DataAnnotation;

namespace Atacadao.Comum.Pesquisa
{
    /// <summary>
    /// Classe para aplicação de máscara nos controles de tela
    /// </summary>
    /// <remarks>
    /// a - Represents an alpha character (A-Z,a-z)
    /// 9 - Represents a numeric character (0-9)
    /// * - Represents an alphanumeric character (A-Z,a-z,0-9)
    /// </remarks>
    public class MascaraAttribute : Attribute, ITemplate
    {
        private static string defaultTemplateName = "Mascara";

        public MascaraAttribute(string mascara)
        {
            this.Mascara = mascara;
            this.nome = defaultTemplateName;
        }

        public MascaraAttribute(string mascara, string template)
        {
            this.Mascara = mascara;
            this.nome = template;
        }

        private string nome;
        public string Nome
        {
            get { return nome; }
        }

        public MascaraAttribute()
        {
        }


        /// <summary>
        /// Mascará do controle.
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        public string Mascara { get; set; }

    }
}